package com.example.demo.controller;

import com.example.demo.model.Result;
import com.example.demo.service.CommentService;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/com")
@AllArgsConstructor
public class CommentController {

    private CommentService commentService;

    @GetMapping("/{id}")
    public Result getComment(@PathVariable("id") Integer id) {
        return commentService.getCommentByProductId(id);
    }
}
